/*
 * @Descripttion:
 * @Author: YuZhenJing
 * @Date: 2020-01-01 11:48:46
 * @LastEditors: YuZhenJing
 * @LastEditTime: 2020-05-14 08:36:33
 */
import vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import singleSpaVue from 'single-spa-vue'
import elementUI from 'element-ui'
import Fragment from 'vue-fragment'
import AsmClient from 'asm-client'
import VueNavTree from 'vue-nav-tree'
import AsmAxios from './boot/asmAxios'
import './boot/plugin'

vue.use(Fragment.Plugin)
vue.use(elementUI)
vue.use(VueNavTree)
vue.use(AsmClient)
vue.use(AsmAxios)

vue.prototype.coreRootUrl = {
  asmCore: '/asmcore/'
}
vue.config.productionTip = false

const appOptions = {
  el: '#app',
  render: h => h(App),
  router,
  store
}

if (process.env.VUE_APP_SINGLERUN === 'true') {
  // eslint-disable-next-line no-unused-expressions
  import('asm-client/lib/asm-style/reset/index.css')
  // eslint-disable-next-line no-unused-expressions
  import('asm-client/lib/asm-style/line-awesome/css/line-awesome.min.css')
  // eslint-disable-next-line no-unused-expressions
  import('element-ui/lib/theme-chalk/index.css')
  new vue(appOptions)
}

const vueLifecycles = singleSpaVue({
  Vue: vue,
  appOptions: appOptions
})

export const bootstrap = vueLifecycles.bootstrap
export const mount = vueLifecycles.mount
export const unmount = vueLifecycles.unmount
